#include "pipeline_initializer.h"
#include "pipeline_start.h"
#include "pipeline_start_api.h"

#include <napi/native_api.h>
#include <hilog/log.h>
#include <thread>
#include <uv.h>
#include <ace/xcomponent/native_interface_xcomponent.h>
#include <hilog/log.h>
#include <napi/native_api.h>
#include <thread>

#include "app_main.h"
#include "base/thread/background_task_executor.h"
#include "foundation/arkui/ace_engine/adapter/ohos_keels/stage/ability/stage_asset_provider.h"
#include "foundation/arkui/ace_engine/frameworks/base/utils/system_properties.h"

extern uv_loop_s* g_loop;

namespace Keels::Ace::Platform {
void PipelineInitializer::SetCacheDir(const std::string& cacheDir)
{
    AbilityRuntime::Platform::StageAssetProvider::GetInstance()->SetCacheDir(cacheDir);
}

void PipelineInitializer::SetDisplayDensity(double displayDensity)
{
    Keels::Ace::SystemProperties::SetResolution(displayDensity);
}

void PipelineInitializer::StartRSRenderThread()
{
    Keels::Rosen::ResetRsRenderThreadWaitingFlag();
    Keels::Rosen::StartRSRenderThread();
}

void PipelineInitializer::StopRSRenderThread()
{
    Keels::Rosen::StopRSRenderThread();
}

void PipelineInitializer::SetUVLoop(uv_loop_t* loop)
{
    LOGD("[PipelineInitializer::SetUVLoop][uv_loop:%{public}p]", loop);
    g_loop = loop;
}
} // namespace Keels::Ace::Platform

#endif
